hysop.backend.device.opencl.opencl_allocator module¶
- class hysop.backend.device.opencl.opencl_allocator.OpenClAllocator(queue, mem_flags=1, verbose=None)[source]¶
Bases:
AllocatorBase
Base class for OpenCl backend allocators.
Initialize a TaggedObject with a tag prefix/postfix/formatter, all optional.
- allocate(nbytes, **kwds)[source]¶
Wraps _allocate_impl to raise an MemoryError if a cl.Error with the is_out_of_memory flag. Should return an hysop.core.memory.buffer.OpenClBuffer
- property context¶
- property device¶
- property mem_flags¶
- property queue¶
- class hysop.backend.device.opencl.opencl_allocator.OpenClDeferredAllocator(queue, mem_flags=1, verbose=None)[source]¶
Bases:
OpenClAllocator
Deferred OpenCL allocator, memory is allocated when used on device.
Initialize a TaggedObject with a tag prefix/postfix/formatter, all optional.
- is_deferred = True¶
- class hysop.backend.device.opencl.opencl_allocator.OpenClImmediateAllocator(queue, mem_flags=1, verbose=None)[source]¶
Bases:
OpenClAllocator
Immediate OpenCL allocator, memory allocation is not deferred. Convenient for memory pools and to catch allocation errors early.
Initialize a TaggedObject with a tag prefix/postfix/formatter, all optional.
- is_deferred = False¶